﻿using Kn.DLMS;
using Kn.DLMS.Internal;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsApplication3;


namespace Kn.ALICE
{
    public class ALICE_Chart
    {
        public ConcurrentQueue<byte[]> FrameQueueDown = new ConcurrentQueue<byte[]>();
        public ConcurrentQueue<byte[]> FrameQueueUp = new ConcurrentQueue<byte[]>();

        // 入队数据
        public void EnqueueData(byte[] data)
        {
            FrameQueueDown.Enqueue(data);
        }

     
 
        public byte[] DequeueFrame()
        {
            byte[] dequeuedFrame = null;
            if (FrameQueueDown.TryDequeue(out byte[] frame))
            {
                dequeuedFrame = frame;
            }
            return dequeuedFrame;
        }

        public bool IsQueueEmpty()
        {
            return (FrameQueueDown.IsEmpty);
        }

    }
}
